<?php global $user; ?>
<div class="page">
    <div id="top-bar">
        <div class="wrapper">
            <ul class="top-nav">
                <li class="logo">
                    <a href="<?php echo $base_path . 'home';?>"><?php echo $site_name;?></a>
                </li>
                <?php if ($main_menu): ?>
                    <?php print theme('links__system_main_menu', array(
                      'links' => $main_menu,
                      'attributes' => array(
                        'id' => 'main-menu-links',
                        'class' => array('links', 'clearfix'),
                      ),
                      'heading' => array(
                        'text' => t('Main menu'),
                        'level' => 'h2',
                        'class' => array('element-invisible'),
                      ),
                    )); ?>
                <?php endif; ?>
            </ul>
            <?php if($user->uid > 0):?>
                <div class="logout"><?php print $user->name;?> (<?php print l('Exit', 'user/logout');?>)</div>
            <?php else:?>
                <?php print l('Register', 'user/register', array('attributes' => array('class' => array('btn', 'sign-up'))));?>
               <?php print l('Login', 'user/login', array('attributes' => array('class' => array('btn', 'login'))));?>
            <?php endif;?>
        </div>
    </div>
    <div class="clear"></div>
    <div id="Content">
        <div class="wrapper">
                <?php if ($title && !$is_front): ?>
                <h1 class="title" id="page-title">
                    <?php print $title; ?>
                </h1>
                <?php endif; ?>
                <?php if ($messages): ?>
                <div id="messages">
                    <div class="section">
                        <?php print $messages; ?>
                    </div>
                </div> <!-- /.section, /#messages -->
                <?php endif; ?>
                <?php if ($tabs && (user_access('administrator') || ($user->uid > 0 && arg(0) == 'user') && is_numeric(arg(1)))): ?>
                <div class="tabs">
                    <?php print render($tabs); ?>
                </div>
                <?php endif; ?>
                <?php print render($page['content']); ?>
            <div class="clear"></div>
        </div>
    </div>
    <div id="footer">
        <div class="wrapper">
                <?php print render($page['footer']);?>
            <span class="copyright">&copy; <?php print date('Y', time());?> <span><?php print variable_get('site_name', 'Warehouse');?></span></span>
        </div>
        <div class="clear"></div>
    </div>
</div>
<div id="dialog_box" style="display: none;"></div>